﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="Catering.TestPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>采购计划</title>
<link rel="stylesheet" type="text/css" href="/Style/head.css"/>
<link rel="stylesheet" type="text/css" href="/Style/center.css"/>
    <link href="/Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="/Scripts/zhezhao.js" type="text/javascript"></script>
    <script src="/Scripts/Calendar.js" type="text/javascript"></script>
<style type="text/css">
.top_left_table{ width:998px; margin-left:0px; background:none}
.xxk_button{ background:url(../../Images/table_top02.gif);}
</style>
<script language="javascript" type="text/javascript">

    function Add_Purchase_Info() {
        var str_AddPice = "";
        var stes = $("#Purchase_Info");
        $("#Purchase_Info").each(function () {
            if ($(this).html().toString().indexOf("add") > 0) {
                str_AddPice = str_AddPice + "|" + $(this).find("[name='mingcheng']").val() +
                        "," + $(this).find("[name='chuangjian']").val() +
                        "," + $(this).find("[name='bianji']").val() +
                        "," + $(this).find("[name='chuangren']").val() +
                "," + $(this).find("[name='bianren']").val() +
                "," + $(this).find("[name='beizu']").val();

            }
        });



        $.ajax({
            type: "Post",
            url: "../../PostDate.aspx/Caigou_Info_Add_Row",
            data: "{'Add_Raw_Info':'" + str_AddPice + "','CGID':'1'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                alert(str_AddPice);
                window.location.href = "caigou_Edit.aspx?CGID=" + data.d[0];
            }
        });


    }
    function Del_Purchase_Info(dates) {
        if (!confirm("确定删除?")) {
            return;
        }

        var test = $("#add_" + dates).html();
        if (test == null) {
            $.ajax({
                type: "Post",
                url: "../../PostDate.aspx/Purchase_Info_Del",
                data: "{'Select_Raw_ID':'" + dates + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "OK") {
                        alert("删除成功！");
                        history.go(0);
                    }
                }
            });
        } else {
            $("#add_" + dates).remove();
        }
    }
    function buy_select_Page() {
        $("#hf_page").val($("#buyID").val());
        $("#but_buy").click();
    }
    
</script>
<script language="javascript" type="text/javascript">
    function add_null_row() {


        var i = Math.floor(Math.random() * 1000);

        var strrow =

        "  <tr id=\"add_" + i + "\">" +
        " <th class=\"left_td\"></th>" +
        " <td> <input  style=\"width:30px\" type=\"text\" id=\"mingcheng_" + i + "\" name=\"mingcheng\" /></td>" +
        " <td> <input style=\"width:30px\"  type=\"text\" onfocus=\"calendar();\"id=\"chuangjian_" + i + "\" name=\"chuangjian\" /></td>" +
        " <td> <input style=\"width:30px\" type=\"text\" onfocus=\"calendar();\"id=\"bianji_" + i + "\" name=\"bianji\" /></td>" +
        " <td> <input style=\"width:30px\" type=\"text\" id=\"chuangren_" + i + "\" name=\"chuangren\" /></td>" +
        " <td> <input style=\"width:30px\" type=\"text\" id=\"bianren_" + i + "\" name=\"bianren\" /></td>" +
        " <td> <input style=\"width:30px\" type=\"text\" id=\"beizu_" + i + "\" name=\"beizu\" /></td>" +
        " <td><a href=\"#\"><img id =\"weiqi\" src=\"../../Images/file.gif\" onclick=\"Add_Purchase_Info()\"/></a></td>" +
        " <td><a href=\"#\"><img src=\"../../Images/trash.gif\" onclick=\"Del_Purchase_Info(" + i + ")\"/></a></td>" +
        "</tr>";

        $("#Purchase_Info").append(strrow);
    }
</script>
</head>

<body>
<form id="form1" runat="server">
<asp:HiddenField ID="hf_page" runat="server" Value="1" />
<%--<asp:Button ID="but_buy" runat="server" OnClick="buy_select_Page" style="display:none" />--%>
<div id="div_se_1" class="nav_2"  style="display:none">
  <div class="nav_2_1"><img src="../../Images/nav2_bg1.gif" /></div>
  <ul>
    <li><a href="#"><span class="lvse_border">配餐人群设置</span></a></li>
    <li><a href="#"><span class="feise_border">选择配餐日期</span></a></li>
    <li style="background:none"><a href="#"><span class="feise_border">生成食谱</span></a></li>
  </ul>
  <div class="nav_2_3"><img src="../../Images/nav2_bg2.gif" /></div>
</div>
<div id="div_se_2" class="nav_se" style="display:none">
  <div class="nav_se_1"><img src="../../Images/nav2_bg1.gif" /></div>
  <ul>
    <li><a href="#"><span class="lvse_border">周食谱清单</span></a></li>
    <li><a href="#"><span class="lvse_border">周食谱检查表</span></a></li>
  </ul>
  <div class="nav_se_3"><img src="../../Images/nav2_bg2.gif" /></div>
</div>
    

<div class="nav_3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="width60">作业区：</td>
    <td width="190px">
        <asp:DropDownList ID="Dr_Operaction" runat="server" 
            CssClass="buttonPopupDiv179" AutoPostBack="True" 
            >
        </asp:DropDownList>
   </td>
    <td class="width60">班  组：</td>
    <td width="190px"> <asp:DropDownList ID="Dr_Class" runat="server" CssClass="buttonPopupDiv179">
        </asp:DropDownList>
        </td>
    <td class="width60">年  份：</td>
   
    <td width="95px"> 
    
    <asp:DropDownList ID="dr_year" CssClass="buttonPopupDiv82" runat="server">
    <asp:ListItem Value="0" Text="选择年份"></asp:ListItem>
    <asp:ListItem Value="1999" Text="1999"></asp:ListItem>
    <asp:ListItem Value="2000" Text="2000"></asp:ListItem>
    <asp:ListItem Value="2001" Text="2001"></asp:ListItem>
    <asp:ListItem Value="2002" Text="2002"></asp:ListItem>
    <asp:ListItem Value="2003" Text="2003"></asp:ListItem>
    <asp:ListItem Value="2004" Text="2004"></asp:ListItem>
    <asp:ListItem Value="2005" Text="2005"></asp:ListItem>
    <asp:ListItem Value="2006" Text="2006"></asp:ListItem>
    <asp:ListItem Value="2007" Text="2007"></asp:ListItem>
    <asp:ListItem Value="2008" Text="2008"></asp:ListItem>
    <asp:ListItem Value="2009" Text="2009"></asp:ListItem>
    <asp:ListItem Value="2010" Text="2010"></asp:ListItem>
    <asp:ListItem Value="2011" Text="2011"></asp:ListItem>
    <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
    <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
    <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
    <asp:ListItem Value="2015" Text="2015"></asp:ListItem>
    <asp:ListItem Value="2016" Text="2016"></asp:ListItem>
    <asp:ListItem Value="2017" Text="2017"></asp:ListItem>
    <asp:ListItem Value="2018" Text="2018"></asp:ListItem>
    <asp:ListItem Value="2019" Text="2019"></asp:ListItem>

    </asp:DropDownList>
   </td>
    <td class="width60">
   月  份：
    </td>
    <td width="95px"> 
        <asp:DropDownList ID="dr_Moth" runat="server" >
        <asp:ListItem Value="1" Text="1"></asp:ListItem>
        <asp:ListItem Value="2" Text="2"></asp:ListItem>
        <asp:ListItem Value="3" Text="3"></asp:ListItem>
        <asp:ListItem Value="4" Text="4"></asp:ListItem>
        <asp:ListItem Value="5" Text="5"></asp:ListItem>
        <asp:ListItem Value="6" Text="6"></asp:ListItem>
        <asp:ListItem Value="7" Text="7"></asp:ListItem>
        <asp:ListItem Value="8" Text="8"></asp:ListItem>
        <asp:ListItem Value="9" Text="9"></asp:ListItem>
        <asp:ListItem Value="10" Text="10"></asp:ListItem>
        <asp:ListItem Value="11" Text="11"></asp:ListItem>
        <asp:ListItem Value="12" Text="12"></asp:ListItem> 
    </asp:DropDownList>
    </td>
    <td><asp:ImageButton runat="server" ID="Seach_Purchase" ImageUrl="/Images/so.gif" /></td>
    <td>
    <input type="button" id="add_null" style=" height:28px; width:85px; cursor:pointer; background-image:url(/Images/add.gif); background-repeat:no-repeat; border:0";class="add_botton" onclick="add_null_row()" />
   
    </td>
  </tr>
</table>
</div>


<div class="table_box">
  <div class="xxk_button">
    
  </div>
  <div class="table_box02">
    
    
    <div class="table_box02_02" style="margin-bottom:20px;">
     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="top_left_table">
      <tr class="top_td">
        <th width="70px">序号</th>
        <th width="153px">采购计划名称</th>
        <th width="105px">编制日期</th>
        <th width="105px">修改日期</th>
        <th width="85px">编制人</th>
        <th width="85px">修改人</th>
        <th width="265px">备注</th>
        <th>编辑</th>
        <th>删除</th>
      </tr>
        <asp:Repeater ID="Repeater1" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <th style="border-bottom: 1px solid #ccc; background-color: #f5f5f5; border-right: 1px solid #ccc;
                                            height: 32px">
                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                                        </th>
                                        <td>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("PPName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Date") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("EditDate") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Eval("bName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("uName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Eval("pcback") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label9" runat="server" Text='<%# Eval("pcback") %>'></asp:Label>
                                        </td>
                                        <td>
                                        <a href="caigou_Edit.aspx?CGID='<%# Eval("id") %> '><img src="/Images/file.gif" /></a></td>
                                        <td>
                                        <img src="/Images/trash.gif" onclick="Del_Purchase_Info('<%# Eval("id") %> ')"/></a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr style="background-color: #f4fbff; height: 32px">
                                           <th style="border-bottom: 1px solid #ccc; background-color: #f5f5f5; border-right: 1px solid #ccc;
                                            height: 32px">
                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                                        </th>
                                        <td>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("PPName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("Date") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("EditDate") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Eval("bName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("uName") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Eval("pcback") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label9" runat="server" Text='<%# Eval("pcback") %>'></asp:Label>
                                        </td>
                                        <td>
                                        <a href="caigou_Edit.aspx?CGID='<%# Eval("id") %> '><img src="/Images/file.gif" /></a></td>
                                        <td>
                                        <img src="/Images/trash.gif" onclick="Del_Purchase_Info('<%# Eval("id") %> ')"/></a>
                                        </td>
                                    </tr>
                                </AlternatingItemTemplate>
                            </asp:Repeater>
                             <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:Label ID="lblCurPage" runat="server"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label6" runat="server" Text="每页10条"></asp:Label>
                                </td>
                                <td>
                                </td>
                                <td>
                                    <div class="paper_n">
                                        <ul>
                                            <li class="paper_H">
                                                <asp:HyperLink ID="InkFirst" runat="server">首页</asp:HyperLink></li>
                                            <li class="paper_U">
                                                <asp:HyperLink ID="InkPrev" runat="server">上一页</asp:HyperLink></li>
                                            <li class="paper_D">
                                                <asp:HyperLink ID="InkNext" runat="server">下一页</asp:HyperLink></li>
                                            <li class="paper_F">
                                                <asp:HyperLink ID="InkLast" runat="server">末页</asp:HyperLink></li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
      <tr>
        <td colspan="9" class="paper_td">
          
          <%--<div class="Inall_paper">总共采购计划<span><%= ViewState["count"] %></span>个</div>
          <div class="paper_div">第<span>1/15</span>页　　每页<span>13</span>条</div>
          <div class="paper_n">
            <ul>
              <li class="paper_H"><a href="?PageID=1">首页</a></li>
              <li class="paper_U"><a href="?PageID=0">上一页</a></li>
              <li class="paper_n02"><a href="?PageID=1">1</a></li>
              <li class="paper_n02"><a href="?PageID=2">2</a></li>
              <li class="paper_n02"><a href="?PageID=3">3</a></li>
              <li class="paper_n02"><a href="?PageID=4">4</a></li>
              <li class="paper_n02"><a href="?PageID=5">5</a></li>
              <li class="paper_n02"><a href="?PageID=6">6</a></li>
              <li class="paper_D"><a href="?PageID=7">下一页</a></li>
              <li class="paper_F"><a href="?PageID=6">末页</a></li>
              
            </ul> 
             <asp:DropDownList ID="dr_PageCount" runat="server" AutoPostBack="True" 
                  Width="50px" onselectedindexchanged="dr_PageCount_SelectedIndexChanged"  >
             <asp:ListItem>5</asp:ListItem>
             <asp:ListItem>10</asp:ListItem>
             <asp:ListItem>15</asp:ListItem>
             <asp:ListItem>20</asp:ListItem>
                </asp:DropDownList>
           
          </div>
          <div class="JUMP_paper">转到<input type="text"  id="buyID"    onpropertychange="buy_select_Page()" class="inupt_widht30" />跳转</div>--%> 
        </td>
      </tr>
    </table>
    </div>
  </div>
</div>
<div class="footer"> <strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span> </div>

<!--遮罩层-->
    <div id="div1" class="bg">
    </div>
    <!--弹出层-->
    <div id="div2" class="center_div" >
        <table>
            <tr>
                <td>
                    <div class="div_0207 left_width400" style="width: 100%">
                        <h1>
                            <img src="../../../Images/cp_h1_03.gif" />自动生成采购计划</h1>
                      	<table align="left">
                        	<tr>
                            	<td>作业区：</td>
                                <Td><select style="width:130px"></select></Td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>班组：</td>
                                <Td><select style="width:130px"></select></Td>
                            </tr>
                            <tr>
                            	<Td>起始日期：</Td>
                                <td><select style="width:130px"></select></td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>结束日期：</td>
                                <td><select style="width:130px"></select></td>
                            </tr>
                            <tr>
                            	<td align="left" colspan="6"><font size="3">可生成本时间区间的食谱列表</font></td>
                            </tr>
                        </table>    
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table">
                            <thead>
                                    <tr>
                                        <td style="width: 50px">
                                            序号
                                        </td>
                                        <td style="width: 200px">
                                            名称
                                        </td>
                                        <td style="width: 80px">
                                            食谱周期
                                        </td>
                                        <td style="width: 130px">
                                            创建时间
                                        </td>
                                        <td style="width: 80px">
                                            创建人
                                        </td>
                                        <td style="width: 65px">
                                            平均年龄
                                        </td>
                                        <td style="width: 65px">
                                            人数
                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td class="xh_td">
                                            1
                                        </td>
                                        <td>
                                            2012-02-02至2012-02-25食谱
                                        </td>
                                        <td>
                                            5
                                        </td>
                                        <td>
                                            2012-02-02
                                        </td>
                                        <Td></Td>
                                        <td>
                                            5.04
                                        </td>
                                        <Td></Td>
                                    </tr>
                                </tbody>
                                <tbody>
                                    <tr>
                                        <td class="xh_td">
                                            1
                                        </td>
                                        <td>
                                            2012-02-02至2012-02-25食谱
                                        </td>
                                        <td>
                                            5
                                        </td>
                                        <td>
                                            2012-02-02
                                        </td>
                                        <Td></Td>
                                        <td>
                                            3.11
                                        </td>
                                        <Td></Td>
                                    </tr>
                                </tbody>
                        </table>
                    </div>
                </td>
            </tr>
            <tr align="center">
                <td align="center">
                        <table align="center">
                            <tr class="img_touxiang" align="center">
                                <td align="center">
                                    <a href="#">开始生成</a>
                                </td>
                                <td align="center">
                                    <a href="#" onclick='divhidel("div1","div2")'>关闭</a>
                                </td>
                            </tr>
                        </table>
                </td>
            </tr>
        </table>
    </div>
</form>
</body>
</html>